/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package aypuyprueba.agent;

import BESA.ExceptionBESA;
import BESA.Kernel.Agent.AgentBESA;
import BESA.Kernel.Agent.KernellAgentExceptionBESA;
import BESA.Kernel.Agent.StateBESA;
import BESA.Kernel.Agent.StructBESA;
import BESA.Log.ReportBESA;
import aypuyprueba.guard.SMA_ReceiveHandlerAYPUY;
import aypuyprueba.guard.SMA_ReceiveFileAYPUY;

/**
 *
 * @author Ayllu
 */
public class AgentTest extends AgentBESA {

    public AgentTest(String alias, double passwd) throws KernellAgentExceptionBESA {
        super(alias, new StateBESA() {}, getStruct(), passwd);
    }

    @Override
    public void setupAgent() {
    }

    @Override
    public void shutdownAgent() {
    }

    private static StructBESA getStruct() {
        StructBESA aStruct = new StructBESA();
        try {
            aStruct.addBehavior("BehAgentAypuy");
            aStruct.bindGuard("BehAgentAypuy", SMA_ReceiveFileAYPUY.class);
            aStruct.bindGuard("BehAgentAypuy", SMA_ReceiveHandlerAYPUY.class);
        } catch (ExceptionBESA exbesa) {
            ReportBESA.error(exbesa);
        }
        return aStruct;
    }
}
